package org.chen.aao.common.subscription.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@TableName("subscriptions")
public class Subscription {
    @TableId(type = IdType.AUTO)
    private Long id;
    
    private Long userId;
    private String productId;
    private String orderId;
    private String purchaseToken;
    private String plan; // FREE, BASIC, PREMIUM
    private String status; // ACTIVE, EXPIRED, CANCELLED, PENDING
    private LocalDateTime purchaseTime;
    private LocalDateTime expiryTime;
    private Boolean autoRenew;
    private BigDecimal price;
    private String currency;
    
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;
    
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
}